<template>
	<div>
		<!-- <view>
			<uni-list>
				<uni-list-item v-for="(item,index) in Data" :key="index" :title="item.content"  @click="casebyid(item.id)" showArrow clickable></uni-list-item>
			</uni-list>
		</view> -->
		<view class="content">
			<view class="page-section" indexListBox>
				<view class="indexList" v-for="(item,index) in Data" :key="index">
					<view class="info">
						改善方案ID:{{item.id}}
					</view>
					<view>
						内容:{{item.content}}
					</view>
					<view>
						类型:{{item.typeid}}
					</view>
					<view>
						方案id:{{item.caseid}}
					</view>
					
					<!-- <view v-html="item.caseName"></view> -->
				</view>
				<view>
					<view>
						<button type="primary" @click="taskadd">添加任务</button>
					</view>
				</view>
			</view>
		</view>
	</div>
</template>
<script>
let caseTaskVo={"current":1,"pagesize":3}
		export default {
			data() {
				return {
					Data:[
						{
							id:'',
							content:''
						}
					]
				}
			},
			methods:{
				casebyid(caseId){
					console.log(caseId)
					uni.navigateTo({
						url:'/pages/task/aa'
					})
				},
				schemeEsByIid(){
					uni.request({
					    url: 'http://localhost:7000/case/a/caseContentById', //仅为示例，并非真实接口地址。
					    data:caseTaskVo,
					    method: 'POST',
					    success: (res) => {
							console.log(caseTaskVo)
							console.log(res.data)
					        this.Data=res.data.data
							
					    }
					});
				},
				tasklist(){
					
					uni.navigateTo({
						url:'../task/aa',
					})
				},taskadd(){
					console.log("------------"+this.Data[0].content)
					uni.request({
					    url: 'http://localhost:7000/task/task/taskAdd', //仅为示例，并非真实接口地址。
					    data:{
							taskName:this.Data[0].content,
							taskNum:30,
							taskType:this.Data[0].typeid,
							taskCaseid:this.Data[0].caseid
						},
					    method: 'POST',
					    success: (res) => {
							uni.navigateTo({
								url:'../../task/index'
							})
					    }
					});
				}
			},
			mounted() {
				this.schemeEsByIid()
			},
			onLoad :function(obj){
				caseTaskVo.id=obj.id
				console.log("----------"+caseTaskVo.id)
			}
		}
	</script>

<style>
</style>